package com.chanyachting.emall.action.systemparameters;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.chanyachting.emall.domain.Systemparameters;
import com.chanyachting.emall.form.SystemparametersForm;
import com.chanyachting.emall.service.SystemparametersService;
import com.chanyachting.emall.serviceImpl.SystemparametersServiceImpl;


//修改系统参数
public class UpdateAction extends Action {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		SystemparametersForm syform=(SystemparametersForm)form;
		
		Systemparameters syp=new Systemparameters();
		
		BeanUtils.copyProperties(syp, syform);
		
		SystemparametersService sys=new SystemparametersServiceImpl();
		
		sys.updateSystemparameters(syp);  //更新系统参数
		
		
		return mapping.findForward("systemparameter");
	}
	
	
	

}
